/**
 * Created by Administrator on 2016/1/8.
 */
$(function(){
    $(document).on("pageshow","#yxyg_html",function(){

        var $audio = $("#audioPlayer");
        $audio.attr("src","audio/保龄男孩.mp3");
        $audio.attr("loop","loop");
        $audio[0].play();

        var $p = $("#yxyg_html");
        var $title = $p.find("#title");
        $title.css({
            left:$(window).width()/2-$title.width()/2,
            top:350
        });
        swiperAnimateMany($title);

        var dept = purl().fparam("dept");
        var $dept =  $p.find("#dept");
        $dept.html("所属部门："+dept);
        $dept.css({
            left:$(window).width()/2-$dept.width()/2,
            top:450
        });
        swiperAnimateMany($dept);
        var m = purl().fparam("m");

        var users = purl().fparam("users");



        var $bjr = $p.find("#bjr");
        $bjr.html("颁奖人："+m);
        $bjr.css({
            left:$(window).width()/2-$bjr.width()/2,
            top:500
        });
        swiperAnimateMany($bjr);

        var $hjr = $p.find("#hjr");

        var userArr = users.split(",");


        $hjr.css({
            left:0,
            top:550,
            width:"100%"
        });
        $hjr.html("");
        $.each(userArr,function(i,d){
            var l = 0;
            if(userArr.length==1){
                l = $hjr.width()/2-60;
            }else{
                if(i%2==0){
                    l = $hjr.width()/2+250*i;
                }
                else{
                    l = $hjr.width()/2-220*i;
                }
            }
            var html = [
                '<div  class="signin-item signin-item-show ani mjf" style="position:absolute;width:120px;left:'+l+'px"  swiper-animate-effect="bounceInDown" swiper-animate-duration="2.5s" swiper-animate-delay="1s">,',
                '<div class="signin-item-img"  >,',
                '    <img',
                '    src="images/photo/'+d+'.jpg">',
                '    </div>',
                '    <span class="signin-item-text">'+d+'</span>',
                '</div>'
            ].join("");
            $hjr.append(html);

            swiperAnimateMany($hjr.find(".signin-item"));
        });
    })
});